<template>
    <div class="front-padding">
        <div class="table bg-white bj">
            <el-scrollbar style="height: 100%;">
                <el-table :data="subsidiaryRow" border @cell-click="handClick" :highlight-current-row="true">
                    <el-table-column property="givenName" label="供应商名称"></el-table-column>
                    <el-table-column property="givenNumberOne" label="采购订单号"></el-table-column>
                    <el-table-column property="givenNumberTwo" label="供应商订单号"></el-table-column>
                </el-table>
                <div class="btn">
                    <el-button type="primary" @click="save">确定</el-button>
                    <el-button type="danger" @click="close">关闭</el-button>
                </div>
            </el-scrollbar>
        </div>
    </div>
</template>
<script>
/**
 * 2019/2/28
 * zqf
 * 选择采购合同编号组件
 */
export default {
    data() {
        return{
            subsidiaryRow: this.$store.state.initializeStore.cgData,
            rowData: []
        }
    },
    methods: {
        handClick(row){
            this.rowData = row;
        },
        save(){
            this.$store.commit('initializeStore/updatecgCompactObj', [this.rowData]);
            this.close();
        },
        close() {                               //关闭新增弹窗
            let index = parent.layer.getFrameIndex(window.name);    //先得到当前iframe层的索引
            parent.layer.close(index);
        },
    },
    mounted() {
    }
}
</script>
<style lang="less" scoped>
    .table{min-width: 730px;}
    .btn{position: absolute;bottom: 0;right: 0;margin: 0 10px 10px 0;}
</style>


